﻿using System;
using Sripirom.ATS.Core.Logging;
using StructureMap;
using StructureMap.Configuration.DSL;


namespace Sripirom.ATS.Core.ServiceModel.Description
{                                  
    public class ServiceBootStrapper   
    {
        public static void ConfigureDependencies(RegistryCollection registryCollection)
        {
            ObjectFactory.Initialize(x =>
            {
                x.AddRegistry(new ControllerRegistry(registryCollection));
            });
          
        }



        public class ControllerRegistry : Registry
        {
            public ControllerRegistry(RegistryCollection registryCollection)
            {
                foreach (RegistryElement registry in registryCollection)
                {
                    For(registry.InterfaceType).Use(registry.ImplementType);
                }

            }

        }
    }
}
